import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false;

import './assets/css/index.scss' // global css

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN'
Vue.use(ElementUI, { locale });

import './icons'
import router from './router'
import store from './store'

// const devInnerWidth= 1920.0; // 开发时的InnerWidth
// const zoomFactor =  window.innerWidth / devInnerWidth;
// require('electron').webFrame.setZoomFactcor(zoomFactor);

import i18n from "./i18n"

import './utils/permission'
import './utils/db'

import Highchart from "highcharts/highcharts";
import HighchartsVue from "highcharts-vue";

import exportingInit from 'highcharts/modules/exporting'
exportingInit(Highchart);

import exportDataInit from 'highcharts/modules/export-data'
exportDataInit(Highchart);

Vue.use(HighchartsVue);
import * as tf from '@tensorflow/tfjs';
Vue.prototype.$tf = tf

import dataV from '@jiaminghi/data-view';

Vue.use(dataV)

Highchart.setOptions({
  lang:{
    contextButtonTitle: i18n.t("chart.contextButtonTitle"),
    decimalPoint: i18n.t("chart.decimalPoint"),
    downloadJPEG: i18n.t("chart.downloadJPEG"),
    downloadPDF: i18n.t("chart.downloadPDF"),
    downloadPNG: i18n.t("chart.downloadPNG"),
    downloadSVG: i18n.t("chart.downloadSVG"),
    drillUpText: i18n.t("chart.drillUpText"),
    loading: i18n.t("chart.loading") ,
    printChart: i18n.t("chart.printChart"),
    resetZoom: i18n.t("chart.resetZoom"),
    resetZoomTitle: i18n.t("chart.resetZoomTitle"),
    viewFullscreen: i18n.t("chart.viewFullscreen"),
    exitFullscreen: i18n.t("chart.exitFullscreen"),
    viewData: i18n.t("chart.viewData")
  }
});

import Print from 'vue-print-nb'
Vue.use(Print);

import DataPrintPanel from './components/print';
Vue.component('DataPrintPanel', DataPrintPanel);

import 'vue-progress-path/dist/vue-progress-path.css'
import VueProgress from 'vue-progress-path'
Vue.use(VueProgress);

import VueTouchKeyboard from "vue-touch-keyboard";
import "vue-touch-keyboard/dist/vue-touch-keyboard.css"; // load default style

Vue.use(VueTouchKeyboard);


import moment from 'moment';
Vue.filter('formatYYYYMMDDHHSS', function(date) {
    return new moment(date).format('YYYY-MM-DD HH:mm:ss')
});

new Vue({
  render: h => h(App),
  router,
  store,
  i18n
}).$mount('#app');

